import { lazy } from "react";
import {createBrowserRouter} from 'react-router-dom'
import Layout from '../luyou/layout/Index'
import Login from '../luyou/login/Index'
import No from '../luyou/404/Index'
const Home=lazy(()=>import('../luyou/home/Index'))
const Table=lazy(()=>import('../luyou/table/Index'))
const Look=lazy(()=>import('../luyou/look/Index'))
const Youd=lazy(()=>import('../luyou/youd/Index'))
export const erji=[
    {
         path:'/home',
         title:'首页',
        element:<Home></Home>,
    },
    {
        path:'/table',
        title:'操作',
        element:<Table></Table>,
    },
    {
        path:'/look',
        title:'换肤',
        element:<Look></Look>,
    },
    {
        path:'/youd',
        title:'有道',
        element:<Youd></Youd>,
    }
]
const router=createBrowserRouter([
    {
        path:'/',
        element:<Layout></Layout>,
        children:erji
    },
    {
        path:'/login',
        element:<Login></Login>
    },
    {
        path:'*',
        element:<No></No>
    }
])
export default router